package com.ddwl.schema.vo.base;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author Fu Zhaohui
 * @date 2015/12/16
 */
@ApiModel(description = "分页返回Vo")
@Setter
@Getter
public class PageVo<T> {

    @ApiModelProperty("总条数")
    private Long total;
    @ApiModelProperty("当前页")
    private int page;
    @ApiModelProperty("页大小")
    private int size;
    @ApiModelProperty("页大小")
    private List<T> data;

    @ApiModelProperty("统计数据")
    private Object statistics;

    public PageVo(Long total, int page, int size, List<T> data) {
        this.total = total;
        this.page = page;
        this.size = size;
        this.data = data;
    }

    public PageVo(Long total, int page, int size, List<T> data,Object statistics) {
        this.total = total;
        this.page = page;
        this.size = size;
        this.data = data;
        this.statistics = statistics;
    }

    public PageVo() {
    }
}
